﻿using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Threading;
using TestFireBroadcastingHostPhone.ViewModel;

namespace TestFireBroadcastingHostPhone.Model
{
    public class AutoTestM : ViewModelBase
    {
        /// <summary>
        /// 自动测试时间定时器
        /// </summary>
        public DispatcherTimer? AutoTestTimer;
        /// <summary>
        /// 自动测试任务来源
        /// </summary>
        public CancellationTokenSource? cancellationTokenSource;//任务来源
        /// <summary>
        /// 自动测试线程
        /// </summary>
        public Task? AutoTest_Task;//创建线程
        /// <summary>
        /// 自动测试开关
        /// </summary>
        public bool Sw_AutoTest = false;
        /// <summary>
        /// 数字示波器连接成功的标志
        /// </summary>
        public bool Oscilloscope_connect = false;
        /// <summary>
        /// 手动设置功放地址完成的标志
        /// </summary>
        public bool set_amplifier_address_finish = false;
        /// <summary>
        /// 稳定电压下限值：可调整
        /// </summary>
        public int output_voltage = DefineTestData.StableVoltageDLimit;
        /// <summary>
        /// 当前开始时间
        /// </summary>
        public DateTime startTime;
        /// <summary>
        /// 测试时间显示
        /// </summary>
        public string displayTestTime = string.Empty;
        /// <summary>
        /// 查询录音状态线程
        /// </summary>
        public Task? QueryRedioStatus;
        /// <summary>
        /// 查询录音状态线程来源
        /// </summary>
        public CancellationTokenSource? QueryRedioCancellationTokenSource;
        /// <summary>
        /// 正在录音的标志
        /// </summary>
        public bool isRedioing = false;
    }
}
